[MLX] Add leaky_relu op handler#20305
Conversation
Lower aten.leaky_relu.default with existing MLX graph nodes and add focused op tests for custom slopes, including slopes above 1.
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/20305
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ✅ You can merge normally! (1 Unrelated Failure)As of commit 1556a0e with merge base 2b1ccd4 ( BROKEN TRUNK - The following job failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@pytorchbot label "release notes: apple" |
| require_kwargs(P.kwargs(n), set(), "aten.leaky_relu") | ||
|
|
||
| x = args[0] | ||
| negative_slope = float(args[1]) if len(args) > 1 else 0.01 |
There was a problem hiding this comment.
Is 0.01 the default value in pytorch?
|
|
||
| @classmethod | ||
| def get_test_configs(cls) -> List["LeakyReLUTest"]: | ||
| return [ |
There was a problem hiding this comment.
Can we have a negative slot None case to test the default you set?
|
Thanks @devin-lai! Overall it looks great, just have some comments on the default value of negative slot. |
|
|
Thanks! 0.01 is the PyTorch default. I’ve handled the None case and added a test for the default path . |
|
Looks great! Thanks for the contribution @devin-lai! |
Summary:
Test Plan:
cc @metascroy